package com.dime.basic.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.uuid.IdUtils;
import com.ruoyi.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dime.basic.mapper.DimeBasediagnosisstandardMapper;
import com.dime.basic.api.domain.DimeBasediagnosisstandard;
import com.dime.basic.service.IDimeBasediagnosisstandardService;

/**
 * 职业诊断标准Service业务层处理
 * 
 * @author Tiny
 * @date 2023-10-23
 */
@Service
public class DimeBasediagnosisstandardServiceImpl implements IDimeBasediagnosisstandardService 
{
    @Autowired
    private DimeBasediagnosisstandardMapper dimeBasediagnosisstandardMapper;

    /**
     * 查询职业诊断标准
     * 
     * @param id 职业诊断标准主键
     * @return 职业诊断标准
     */
    @Override
    public DimeBasediagnosisstandard selectDimeBasediagnosisstandardById(String id)
    {
        return dimeBasediagnosisstandardMapper.selectDimeBasediagnosisstandardById(id);
    }

    /**
     * 查询职业诊断标准列表
     * 
     * @param dimeBasediagnosisstandard 职业诊断标准
     * @return 职业诊断标准
     */
    @Override
    public List<DimeBasediagnosisstandard> selectDimeBasediagnosisstandardList(DimeBasediagnosisstandard dimeBasediagnosisstandard)
    {
        return dimeBasediagnosisstandardMapper.selectDimeBasediagnosisstandardList(dimeBasediagnosisstandard);
    }

    /**
     * 新增职业诊断标准
     * 
     * @param dimeBasediagnosisstandard 职业诊断标准
     * @return 结果
     */
    @Override
    public int insertDimeBasediagnosisstandard(DimeBasediagnosisstandard dimeBasediagnosisstandard)
    {
        dimeBasediagnosisstandard.setId(IdUtils.fastUUID());
        dimeBasediagnosisstandard.setCreateTime(DateUtils.getNowDate());
        dimeBasediagnosisstandard.setCreateBy(SecurityUtils.getUsername());
        return dimeBasediagnosisstandardMapper.insertDimeBasediagnosisstandard(dimeBasediagnosisstandard);
    }

    /**
     * 修改职业诊断标准
     * 
     * @param dimeBasediagnosisstandard 职业诊断标准
     * @return 结果
     */
    @Override
    public int updateDimeBasediagnosisstandard(DimeBasediagnosisstandard dimeBasediagnosisstandard)
    {
        dimeBasediagnosisstandard.setUpdateBy(SecurityUtils.getUsername());
        dimeBasediagnosisstandard.setUpdateTime(DateUtils.getNowDate());
        return dimeBasediagnosisstandardMapper.updateDimeBasediagnosisstandard(dimeBasediagnosisstandard);
    }

    /**
     * 批量删除职业诊断标准
     * 
     * @param ids 需要删除的职业诊断标准主键
     * @return 结果
     */
    @Override
    public int deleteDimeBasediagnosisstandardByIds(String[] ids)
    {
        return dimeBasediagnosisstandardMapper.deleteDimeBasediagnosisstandardByIds(ids);
    }

    /**
     * 删除职业诊断标准信息
     * 
     * @param id 职业诊断标准主键
     * @return 结果
     */
    @Override
    public int deleteDimeBasediagnosisstandardById(String id)
    {
        return dimeBasediagnosisstandardMapper.deleteDimeBasediagnosisstandardById(id);
    }
}
